<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>new (ZooomrPhotosetsRuleSetDateUploaded)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File svn/ruby-zooomr-api/Zooomr.Photosets.RuleSet.DateUploaded.rb, line 18</span>
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">a_parameter_hash</span>)
    
    <span class="ruby-identifier">required_params</span> = [<span class="ruby-value str">'date'</span>]
    
    <span class="ruby-constant">ZooomrPhotosetsRuleSet</span>.<span class="ruby-identifier">params_are_valid</span>(<span class="ruby-identifier">required_params</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">a_parameter_hash</span>)
    
    <span class="ruby-keyword kw">if</span> (<span class="ruby-operator">!</span>(<span class="ruby-identifier">a_parameter_hash</span>[<span class="ruby-value str">'date'</span>].<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Date</span>)))
      <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;ZooomrPhotosetsRuleSetDateUploaded: requires a Date object for date&quot;</span>, <span class="ruby-identifier">caller</span>
    <span class="ruby-keyword kw">end</span>
  
    <span class="ruby-identifier">unixtime</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">local</span>(<span class="ruby-identifier">a_parameter_hash</span>[<span class="ruby-value str">'date'</span>].<span class="ruby-identifier">year</span>,
                           <span class="ruby-identifier">a_parameter_hash</span>[<span class="ruby-value str">'date'</span>].<span class="ruby-identifier">mon</span>,
                           <span class="ruby-identifier">a_parameter_hash</span>[<span class="ruby-value str">'date'</span>].<span class="ruby-identifier">mday</span>
                           )
    
    <span class="ruby-ivar">@match_test</span> = <span class="ruby-value str">&quot;0&quot;</span> <span class="ruby-comment cmt"># no match test for Date Uploaded</span>
    <span class="ruby-ivar">@match_type</span> = <span class="ruby-constant">ZooomrPhotosetsRuleSet</span><span class="ruby-operator">::</span><span class="ruby-constant">PHOTOSETMATCH_DATEUPLOADED</span>
    <span class="ruby-ivar">@match_args</span> = <span class="ruby-identifier">unixtime</span>.<span class="ruby-identifier">to_i</span>.<span class="ruby-identifier">to_s</span>
  <span class="ruby-keyword kw">end</span></pre>
</body>
</html>